package com.open.rbac.model.vo.sys;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import com.open.rbac.model.vo.sys.group.OrgUpdate;


/**
 * 组织机构参数
 *
 * @author Riche's
 * @since 2022/8/24
 */
@Schema(name = "OrganizationVo", description = "组织机构参数")
@Getter
@Setter
public class OrganizationVo {

    @Schema(description = "组织机构Id")
    @NotBlank(message = "组织机构Id为必填项", groups = OrgUpdate.class)
    @Length(min = 1, max = 36, message = "组织机构Id长度在 1~36 之间", groups = OrgUpdate.class)
    private String id;

    @Schema(description = "父机构Id")
    @Length(max = 36, message = "父机构Id长度在 1~36 之间")
    private String parentId = "0";

    @Schema(description = "组织机构编码")
    @NotBlank(message = "组织机构编码为必填项")
    @Length(min = 2, max = 36, message = "组织机构编码长度在 2~36 之间")
    private String code;

    @Schema(description = "组织机构名称")
    @Length(min = 2, max = 36, message = "组织机构名称长度在 2~36 之间")
    private String name;

    @Schema(description = "组织机构排序")
    @Range(min = 1, max = 1000, message = "序号取值范围：1 ~ 1000")
    private Integer sort;

    @Schema(description = "是否启用")
    private Boolean enable;

    @Schema(description = "备注")
    @Size(max = 255, message = "备注最长不能超过255个字符")
    private String remark;

}
